function post(path, params, method) {
    method = method || "post";
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);
    for(var key in params) {
        if(params.hasOwnProperty(key)) {
            var h = document.createElement("input");
            h.setAttribute("type", "hidden");
            h.setAttribute("name", key);
            h.setAttribute("value", params[key]);
            form.appendChild(h);
         }
    }
    document.body.appendChild(form);
    form.submit();
}
